<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新闻详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no">
    <meta name="keywords" content="塑连网络科技,互联网公司，新媒体,公司成立于2019年，注册资本1000万元,互联网信息技术服务，微信小程序——全球挤出工程师认证系统">
    <meta name="Description" content="塑连网同时注重新媒体平台的发展，搭建了以服务号、公众号、抖音号为主体的新媒体传播矩阵。目前，塑连网的新媒体矩阵已经成型，并且形成了对行业热点反应迅速，宣传手段多样化，内容制作标准化，推广目标精准化的独特优势，在行业内积累了一定的影响力。">
    <link rel="shortcut icon" href="image/logo.ico" type="image/x-icon">
    <link rel="stylesheet" type="text/css" href="css/animate.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="css/newsDetails.css">
</head>
<body>

<div class="toubuHead" id="toubuHead"></div>
<div class="content_body">

</div>
<div class="foot wenzi_bottom" id="wenzi_bottom"></div>

<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
<script src="js/rem.js"></script>
<script src="layui/layui.js"></script>
<script src="js/loadHF.js"></script>
<script>
    let loadIndex;
    layui.use([ 'layer', 'jquery','flow'], () => {
        let $=layui.jquery;
        let layer=layui.layer;
        let flow = layui.flow;
        flow.lazyimg();

        // 获取点击的id
        function getQueryVariable(variable) {
            let query = window.location.search.substring(1);
            let vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == variable) {
                    return pair[1];
                }
            }
            return (false);
        }
        let idAll = getQueryVariable('id');
        console.log(idAll);
        function movementAjax() {
            layer.ready(function() {
                loadIndex = layer.load(1,{
                    // time:2 * 1000,
                    shade: [1,'#ddd']
                });
            });
            $.ajax({
                type: 'get',
                url: 'https://www.polynk.cn/server/news/all',
                dataType: 'json',
                data: {
                    "id":  idAll,
                },
                success: function (res) {
                    layer.close(loadIndex);
                    let dataList = res.data;
                    if(res.code===200){
                        $.each(dataList, function (idx, val) {
                            if (idAll == val.id) {
                                    let el = `<div class="content1">
                                           <div class="detailtitle animated slideInLeft  textShadow">${val.title}</div>
                                           <p class="detailTime animated slideInRight  textShadow">${val.createTime}</p>
                                           <div class="detailText animated slideInLeft  textShadow">${val.content}</div>

                                      </div>`;
                            // <div class="photo_rongqi"><img src="image/loading.gif" lay-src="${val.pic}" class="detailImg animated slideInRight boxShadow"></div>
                                    $('.content_body').append(el)
                            }
                        });

                        // 图片预览
                        $('.detailText').on('click','img',function () {
                            // console.log('2222photo');
                            layer.photos({
                                photos: '.detailText',
                                anim: 4 //0-6的选择，指定弹出图片动画类型，默认随机
                            });

                        });
                    }

                },
                error: function (xhr, type) {
                    layui.use('layer', function () {
                        layer.msg('稍后再试');
                    })
                }
            });
        }
        $(function () {
            movementAjax();

        })

    })
</script>
</body>
</html>